<?php //debug($ultimoNumero);  ?>
<div class="widget grid12">
    <div class="whead"><h6>DATOS PARA LA HOJA DE RUTA </h6><div class="clear"></div></div>
    <?php echo $this->Form->create('Myhojasruta', array('id' => "validate")); ?>
  
    <div class="formRow">
        <div class="grid3"><label><h3>Fecha: &nbsp;&nbsp;<?php echo date('Y-m-d'); ?></h3></label></div>        
        <div class="clear"></div>
    </div>
    <?php 
    $i=0;
    foreach($ultimoNumero as $num):?>
    <div class="formRow">
        <div class="grid3">
            <label>
                <h3>
                    Ultima Hoja de Ruta: <?php echo $num['Myhojasruta']['numero']; ?>
                    <small><?php echo $num['Sucursale']['nombre']?></small>
                </h3>
            </label>
        </div>
        <div class="grid3">
            <?php
            $ultimoN = $num['Myhojasruta']['numero'];
            $ultimoN++;
            ?>
            <?php echo $this->Form->text("$i.numero", array('value' => $ultimoN, 'disabled'=>'disabled')); ?>
            <?php echo $this->Form->hidden("$i.numero", array('value' => $ultimoN)); ?>
            <?php echo $this->Form->hidden("$i.fecha", array('value' =>date('Y-m-d'))); ?>
            <?php echo $this->Form->hidden("$i.sucursale_id", array('value' =>$num['Sucursale']['id'])); ?>
            <?php echo $this->Form->hidden("$i.trabajo_id", array('value' =>$id_trabajo)); ?>
        </div>
        <div class="clear"></div>
        <div class="grid3"><label>Observaciones:<span class="req">*</span></label></div>
        <div class="grid3">
            <?php echo $this->Form->textarea("$i.observaciones"); ?>
        </div>
    </div>    
    <?php 
    $i++;
    endforeach;?>
    <div class="clear"></div>
    <div class="formRow">
        <input type="submit" value="Generar Hoja de Ruta" class="buttonM bBlack formSubmit" /><div class="clear"></div>            
    </div>
</div>